

<%@ page import="org.tailor.Shirt"%>
<html>
<head>

<meta name="layout" content="mainLayout" />
<g:set var="entityName"
	value="${message(code: 'shirt.label', default: 'Shirt')}" />


</head>
<body>
	<div id="col_middle">

		<div class="body">
			<h1>
				<g:message code="default.edit.label" args="[entityName]" />
			</h1>
			<br />
			<g:if test="${flash.message}">
				<div class="message">
					${flash.message}
				</div>
			</g:if>
			<g:hasErrors bean="${shirtInstance}">
				<div class="errors">
					<g:renderErrors bean="${shirtInstance}" as="list" />
				</div>
			</g:hasErrors>
			<g:form  method="post" controller="shirt" action="save" enctype="multipart/form-data">
				<g:hiddenField name="id" value="${shirtInstance?.id}" />
				<g:hiddenField name="version" value="${shirtInstance?.version}" />
				<div class="dialog">
					<table>
						<tbody>

							<tr class="prop">
								<td valign="top" class="name"><label for="shirtID"><g:message
											code="shirt.shirtID.label" default="Shirt ID" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'shirtID', 'errors')}">
									<g:textField name="shirtID"
										value="${fieldValue(bean: shirtInstance, field: 'shirtID')}" />
									<br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="designName"><g:message
											code="shirt.designName.label" default="Design Name" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'designName', 'errors')}">
									<g:textField name="designName"
										value="${shirtInstance?.designName}" /> <br />
								<br /></td>
							</tr>
							<tr class="prop">
								<td valign="top" class="name"><g:message
										code="shirt.designPicture.label" default="Design Picture" />
								</td>

								<td valign="top" class="value"><img
									src="<g:createLink controller='shirt' action='renderImage' id='${fieldValue(bean: shirtInstance, field:"id")}'/>"
									width="120" height="120"
									title="${fieldValue(bean: shirtInstance, field:"id")}"
									alt="No Photo" /></td>

							</tr>
							<tr>
								<td></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'designPicture', 'errors')}">
									<input type="file" name="designPicture" id="designPicture"
									size="10" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="collar"><g:message
											code="shirt.collar.label" default="Collar" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'collar', 'errors')}">
									<g:select name="collar.id" from="${org.tailor.Collar.list()}"
										optionKey="id" optionValue="collarName" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="cuff"><g:message
											code="shirt.cuff.label" default="Cuff" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'cuff', 'errors')}">
									<g:select name="cuff.id" from="${org.tailor.Cuff.list()}"
										optionKey="id" optionValue="cuffName" /> <br />
								<br /></td>
							</tr>



							<tr class="prop">
								<td valign="top" class="name"><label for="fabric"><g:message
											code="shirt.fabric.label" default="Fabric" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'fabric', 'errors')}">
									<g:select name="fabric" from="${org.tailor.Fabric.list()}"
										optionKey="id" optionValue="fabricName" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="monoText"><g:message
											code="shirt.monoText.label" default="Mono Text" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'monoText', 'errors')}">
									<g:textField name="monoText"
										value="${fieldValue(bean: shirtInstance, field: 'monoText')}" />
									<br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="monogram"><g:message
											code="shirt.monogram.label" default="Monogram" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'monogram', 'errors')}">
									<g:select name="monogram.id"
										from="${org.tailor.Monogram.list()}" optionKey="id"
										optionValue="monogramID" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="note"><g:message
											code="shirt.note.label" default="Note" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'note', 'errors')}">
									<g:textField name="note" value="${shirtInstance?.note}" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="otherAddOn"><g:message
											code="shirt.otherAddOn.label" default="Other Add On" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'otherAddOn', 'errors')}">
									<g:select name="otherAddOn.id"
										from="${org.tailor.OtherAddOn.list()}" optionKey="id"
										optionValue="addOnName" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="pocketType"><g:message
											code="shirt.pocketType.label" default="Pocket Type" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'pocketType', 'errors')}">
									<g:textField name="pocketType"
										value="${fieldValue(bean: shirtInstance, field: 'pocketType')}" />
									<br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="rating"><g:message
											code="shirt.rating.label" default="Rating" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'rating', 'errors')}">
									<g:select name="rating.id" from="${org.tailor.Rating.list()}"
										optionKey="id" optionValue="score" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="shirtBack"><g:message
											code="shirt.shirtBack.label" default="Shirt Back" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'shirtBack', 'errors')}">
									<g:textField name="shirtBack"
										value="${shirtInstance?.shirtBack}" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="shirtFront"><g:message
											code="shirt.shirtFront.label" default="Shirt Front" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'shirtFront', 'errors')}">
									<g:textField name="shirtFront"
										value="${shirtInstance?.shirtFront}" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="shirtName"><g:message
											code="shirt.shirtName.label" default="Shirt Name" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'shirtName', 'errors')}">
									<g:textField name="shirtName"
										value="${shirtInstance?.shirtName}" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="shoulderFit"><g:message
											code="shirt.shoulderFit.label" default="Shoulder Fit" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'shoulderFit', 'errors')}">
									<g:textField name="shoulderFit"
										value="${shirtInstance?.shoulderFit}" /> <br />
								<br /></td>
							</tr>

							<tr class="prop">
								<td valign="top" class="name"><label for="tailor"><g:message
											code="shirt.tailor.label" default="Tailor" />
								</label></td>
								<td valign="top"
									class="value ${hasErrors(bean: shirtInstance, field: 'tailor', 'errors')}">
									<g:select name="tailor.id" from="${org.tailor.Tailor.list()}"
										optionKey="id" value="${shirtInstance?.tailor?.id}" /> <br />
								<br /></td>
							</tr>

						</tbody>
					</table>
				</div>


				<div class="buttons">
					<table>
						<tr>
							<td><span class="button"><g:actionSubmit class="save"
										action="update"
										value="${message(code: 'default.button.update.label', default: 'Update')}" />
							</span>
							</td>
							<td><span class="button"><g:actionSubmit
										class="delete" action="delete"
										value="${message(code: 'default.button.delete.label', default: 'Delete')}"
										onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
							</span></td>
						</tr>
					</table>
				</div>
			</g:form>
		</div>
	</div>
</body>
</html>
